package client;

import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class ClientAFallBackFactory implements FallbackFactory<ClientA> {

    private static ClientA clientA = new ClientA() {
        @Override
        public String getName() {
            System.out.println("getName的Hystrix降级方法");
            return "getName的Hystrix降级方法";
        }

        @Override
        public String getNiceName(String name) {
            System.out.println("getNiceName的Hystrix降级方法");
            return "getNiceName的Hystrix降级方法";
        }

        @Override
        public String timeoutMethod() {
            System.out.println("timeoutMethod的Hystrix降级方法");
            return "timeoutMethod的Hystrix降级方法";
        }
    };

    @Override
    public ClientA create(Throwable throwable) {
        return clientA;
    }
}
